import java.util.Scanner;

/**
   Counts the number of words in a line.
   Input: a string containing the line
   Output: the number of words in the line
*/
public class CountWords
{
   public static void main(String[] args)
   {
      // your work here
      String s; 
      int n;
      int y=0;
      Scanner in = new Scanner(System.in);
      while (in.hasNext() )
      {
         // more work here
         s=in.nextLine();
         n=s.length();
         y=0;
         for(int i=0;i<n;i++) {
            if(s.charAt(i)==' ') {
               y++;
            }
            
         }
      }

      // more work here
      y++;
      System.out.println(y);
   }
}